UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4ycF+sL5zOtTzqNsebFdPVmkv1Ysy9USWgObuOkCo+E='
WHERE
key_id = '62d8255449bc6d7335c352bdf3822ecf7d4dab42d73bc763921abd4803ab8b0c'
AND (
token = '4ycF+sL5zOtTzqNsebFdPVmkv1Ysy9USWgObuOkCo+E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)