UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qBsGvE6G+E+nyXLVfDxi+ISPh/gkW7bIbFSMWhmwcWs='
WHERE
key_id = 'ade6bff09d6cd20f2d89b19b8c6afb6bcc1a44bbb5f4fec5e1c472df24d03e51'
AND (
token = 'qBsGvE6G+E+nyXLVfDxi+ISPh/gkW7bIbFSMWhmwcWs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)