UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '07YYFAw5P4tNZYz+lP2NaW/+PEzlw6q24mbaHN62eks=' 
WHERE 
  key_id = '43fa3c262b83c2f374e5c824c07c11dfbf492e0e817982f4582d4508b95b51c2' 
  AND (
    token = '07YYFAw5P4tNZYz+lP2NaW/+PEzlw6q24mbaHN62eks=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020