UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FLPqOlK4qSlnC8DVCI1kLqlTQOmxsa/8/dxsiv/BQDI='
WHERE
key_id = 'd4a795f6f20a9ce9cb9cf3564dffc8a6cc814cf5fb8f1e65587edc9a51bc3e01'
AND (
token = 'FLPqOlK4qSlnC8DVCI1kLqlTQOmxsa/8/dxsiv/BQDI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)