UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ChX461NX0B1Z6Io2uvIxiW6zSxNdlqkE58+9la4ToYo='
WHERE
key_id = 'eda30a7a66fc03447ede7c29c49082be1d7c90e75b6d655e89db5f1c68860582'
AND (
token = 'ChX461NX0B1Z6Io2uvIxiW6zSxNdlqkE58+9la4ToYo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)