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