UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sy5/YTD+P43UL3pnGC9bvvmEvla18CCDZLUaxt3JIls='
WHERE
key_id = 'd2e5b43e9a787a16194b5437c788a2dfa498421c9a51dd0533a256241ad187dc'
AND (
token = 'sy5/YTD+P43UL3pnGC9bvvmEvla18CCDZLUaxt3JIls='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)