UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JEoFdNdrKr5QV7Ca4Rc7X0VCPYOTvRP+URZ6SF9UyHI='
WHERE
key_id = 'ed15572278f8c5d7d7d572cf4add8ce2b1c6384b7a679243a1c632d2e7b73eff'
AND (
token = 'JEoFdNdrKr5QV7Ca4Rc7X0VCPYOTvRP+URZ6SF9UyHI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)