UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4XJt+DXquzoXayiFqpNC/hF6THlsbnBvnQo7cb5knoo=' 
WHERE 
  key_id = '9a93829699c337ba60f2ce7b0632f29f60f58b7c3dd1099f4c6050bd118cebb4' 
  AND (
    token = '4XJt+DXquzoXayiFqpNC/hF6THlsbnBvnQo7cb5knoo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051