UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZphoqFjznbPhTp50jY1x/P7yyGV5hhQrbzH0+LN6zFo=' 
WHERE 
  key_id = '4b5f99b36c967d86f8d643e6ab038a4d2ae6b13904b2a462184b7a20ede24e64' 
  AND (
    token = 'ZphoqFjznbPhTp50jY1x/P7yyGV5hhQrbzH0+LN6zFo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029