UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Rr4sRcl7+7Pzdg9/JDkKvn7ep73yj08vNK3KicDvnew=' 
WHERE 
  key_id = '07b5bf32b9ea5c6e77de6d758448ded38b0e3e33c8e02380d18b27af76a041c9' 
  AND (
    token = 'Rr4sRcl7+7Pzdg9/JDkKvn7ep73yj08vNK3KicDvnew=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053