UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qINgqo71AlvM0qncE7hWi1o2pf+ViJvARrIO6jq3/uU='
WHERE
key_id = '9440bf5a33f219430288af914f923c9a4bae67a8e9b305355b251b221b192653'
AND (
token = 'qINgqo71AlvM0qncE7hWi1o2pf+ViJvARrIO6jq3/uU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)