UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NAMKpxjhW0+NGupWfvSvENAffxUg26YC2F+xK6fGgYk='
WHERE
key_id = '08614701021de1ba5c914628c6ec942685f5cf36634f423c9e736b7b1670e315'
AND (
token = 'NAMKpxjhW0+NGupWfvSvENAffxUg26YC2F+xK6fGgYk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)