UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2vEeQfwsHw5Q9QPHtAYWWlyXl8Ju8oVi9thbmXRF/5U=' 
WHERE 
  key_id = '9778b5ae6fbe59519fcf096dea0e1b6561605a80dd2592f92340e1ec2aca1f78' 
  AND (
    token = '2vEeQfwsHw5Q9QPHtAYWWlyXl8Ju8oVi9thbmXRF/5U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039