UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pjlyESrBLpjDkeuOYHlxjbL3MTDd424YC2zr5oKypuI='
WHERE
key_id = '8e5c2d04994b1e36d19e61c8361eefa268c5e5f07968f4e655cee8038cc0d7d4'
AND (
token = 'pjlyESrBLpjDkeuOYHlxjbL3MTDd424YC2zr5oKypuI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)