UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vro8qYOSBn/iEmeb5Q/PVJDLrekn6/GSgxLOVFsRq5Y=' 
WHERE 
  key_id = '5142cd091ac7e1a72aa6aa88d6bc690e1c96346d4dc27d139817196e8fbf943a' 
  AND (
    token = 'vro8qYOSBn/iEmeb5Q/PVJDLrekn6/GSgxLOVFsRq5Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030