UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '43JXsxyI1M2yo4WWys0sRoa/7ugLLOoiX8ta+UKos6Y=' 
WHERE 
  key_id = '7295ea5ab9019a108dfed2d2887763f96ef0a200e946dc80c9da79df72fbe636' 
  AND (
    token = '43JXsxyI1M2yo4WWys0sRoa/7ugLLOoiX8ta+UKos6Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044