UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TygHOOL7h9+LOXsgUSUJ2xZxnKkMXZ/EzjUN+8AZ5OQ='
WHERE
key_id = 'ee2fb4f69348037717d973703263bddf823376e34784e05313bc72dc12628f5b'
AND (
token = 'TygHOOL7h9+LOXsgUSUJ2xZxnKkMXZ/EzjUN+8AZ5OQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)