UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tp9qytHl0IMkXpo0gd1qNWzMrHB0lkLEy8bEgVxhnTw='
WHERE
key_id = '44c57da55912bc7372375832e257f5ba8bfe7428a44315a7ae02fbecc394fcb7'
AND (
token = 'tp9qytHl0IMkXpo0gd1qNWzMrHB0lkLEy8bEgVxhnTw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)