UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yfFKYyidO5CUu5T6DGY7p1+5BJHNB+xXe5eKyWyPrnE=' 
WHERE 
  key_id = '23fe55ab4143074d92195a93a5c261c18be6b7f7859d28770161eb380ff0f9dc' 
  AND (
    token = 'yfFKYyidO5CUu5T6DGY7p1+5BJHNB+xXe5eKyWyPrnE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024