UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FOmcDs/v4PIw7bbYahhjUHuPS/nag8e+H09uL/GcDSU=' 
WHERE 
  key_id = '4512eae31d87e5fbb9d521cae65240ca535de471297f3d0efd9c3566e14d3dc9' 
  AND (
    token = 'FOmcDs/v4PIw7bbYahhjUHuPS/nag8e+H09uL/GcDSU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027