UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QtBmn6jWxDZJqhuc/CWXp180JC/ZBUShlWhfm0kW5FI=' 
WHERE 
  key_id = 'c4b896cdf20a90b4970e488d020f2c7723fbf18942de17a605ffe4c4134ae2ca' 
  AND (
    token = 'QtBmn6jWxDZJqhuc/CWXp180JC/ZBUShlWhfm0kW5FI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027