UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IVK8/VODhXj3yPjnpuMnPoCxLN2dQFpo/SoVAhzFRt8=' 
WHERE 
  key_id = '13973732bd96441135bf812a115808d40ccfd27ba0eea8eca7e661a81675f7cc' 
  AND (
    token = 'IVK8/VODhXj3yPjnpuMnPoCxLN2dQFpo/SoVAhzFRt8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019