UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z1tz4erAjbNv3anxoJNoN76632gcnz7II7pe3P3l3mw='
WHERE
key_id = 'add330ba141e62b1bd1e9634109534a95c16b9e9b2d8f3d3ff0bdae857c3060c'
AND (
token = 'z1tz4erAjbNv3anxoJNoN76632gcnz7II7pe3P3l3mw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)