UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TRqw1tiordWc9iQmnEZcINGZiGoWIyWhS6mkFQGzlvc='
WHERE
key_id = '2b0860c5dd3205d6a6e5be51536d3d3b4f00e253db8d3cd6e6753ba10ae5591a'
AND (
token = 'TRqw1tiordWc9iQmnEZcINGZiGoWIyWhS6mkFQGzlvc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)