UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/wQtrR+xzXFDJ/B8BGDyOE/RjFMtneIa+BatcHzgTwo=' 
WHERE 
  key_id = 'd2c861000c99bd8b75b575f9c62a18220949a67820b5607c0b58022c75d826e5' 
  AND (
    token = '/wQtrR+xzXFDJ/B8BGDyOE/RjFMtneIa+BatcHzgTwo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026