UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1fAcBGNtIvexXI5XNvaLPzlw0qpF0AO44Iq4B+bkO/A='
WHERE
key_id = 'd8c0b5b455dbf29f2a14750282b1720dd97a8e18159fc2485feb39de4450dd7c'
AND (
token = '1fAcBGNtIvexXI5XNvaLPzlw0qpF0AO44Iq4B+bkO/A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)