UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A63QMYyHh2Y+9dGPcwRW5IEknRk68QEbkrlOBoGRYh4='
WHERE
key_id = 'b6eadb55756261f719a3b3e6c05e5032c6baa8e2e01946fbd6e54ccd4a6b3a00'
AND (
token = 'A63QMYyHh2Y+9dGPcwRW5IEknRk68QEbkrlOBoGRYh4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)