UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5M0wd/EM4iwa/Uu/2JRBTqJp9BSJ1bAzuHLqunR5EY8=' 
WHERE 
  key_id = '195e8a0e3561e41e8b7023102b21b09002341d293242f8e08eb14e883f0dcf26' 
  AND (
    token = '5M0wd/EM4iwa/Uu/2JRBTqJp9BSJ1bAzuHLqunR5EY8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052