UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lcc9m+Qw73E6+fj0hJnuCZ2NbVRNRaw2qVBOuipkmJE=' 
WHERE 
  key_id = '734e9612ea73dd94a0b4968f1492258d30a4af3f45b9c46f886cca126c279a11' 
  AND (
    token = 'lcc9m+Qw73E6+fj0hJnuCZ2NbVRNRaw2qVBOuipkmJE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019